<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>电气网行业动态</title>
</head>
<link type="text/css" rel="stylesheet" href="static/css/index.css" />
<script type="text/javascript" src="static/js/jquery-1.8.3.min.js"></script>
<body>
	<div class="all">
		<div class="header">
			<span class="header_font">中国电气网</span>
			<ul class="nav">
								<li><a href="index.jsp">网站首页</a></li>
				<li><a href="news.jsp">行业动态</a></li>
				<li><a href="">企业解决方案展示</a></li>
				<li><a href="product.jsp">企业产品展示</a></li>
				<li><a href="">求购信息</a></li>
			</ul>
		</div>
		<div class="header_after"></div>


		<div class="webContainer">
			<div class="center">
				<div class="containerFormsLeft">
					<div class="formMiddleCenter">
						<div class="bannerTextOutWrap">
							<span>产品展示&nbsp; Product</span>
							
						</div>
					</div>
					<div class="formMiddleCenter2">
						<div class="bannerTextOutWrap">
							<span>热点资讯&nbsp; New</span>
							<ul class="productss">
							
							</ul>
						</div>
					</div>
					<div class="formMiddleCenter">
						<div class="bannerTextOutWrap">
							<span>联系方式&nbsp; Contact</span>
							<ul>
								<li><a>联系QQ：258506508</a></li>
								<li><a>手机号码：130000000</a></li>
								<li><a>联系邮箱：contact@fkadjkhsf.co</a></li>
								<li><a>联系电话：020-000000</a></li>
								<li><a>联系地址：XXX省XXX市XXX县XXX路</a></li>
							</ul>
						</div>
					</div>
				</div>
				<div class="containerFormsRight">
					<div class="news_location">
						<span>当前位置:&nbsp;<a href="index.jsp">网站首页</a>&nbsp;>&nbsp;<span>新闻资讯</span></span>
						<div class="news_artical_out"></div>
				</div>		
				</div>
					<div class="pagenation">
					<button id="first"  onclick="fenyeq()"
						disabled="disabled">上一页</button>
					第<input type="text" id="yeshu" style="width: 20px"
						disabled="disabled" value=1>页
					<button id="last"  onclick="fenye()">下一页</button>
				</div>
				<div class="line"></div>
			</div>

		</div>
		<div class="footer">
			<div class="link_address_out">
				<div class="link_address_out_font">
					<span>友情链接</span>
					<div></div>
				</div>
				<div class="link_address_inner">
					<a href="http://www.ces.cn/" title="中国节能网" target="_blank"> <img
						alt="中国节能网" src="static/image/footer1.png" /></a> <a
						href="http://www.zhaoming.cn/" title="中国照明网" target="_blank">
						<img alt="中国照明网" src="static/image/footer2.png" />
					</a> <a href="http://www.cepn.cn/" title="中国环保网" target="_blank"> <img
						alt="中国环保网" src="static/image/footer3.png" /></a> <a
						href="http://www.yejin.cn/" title="中国冶金网" target="_blank"> <img
						alt="中国冶金网" src="static/image/footer4.png" /></a> <a
						href="http://www.huagong.cn/" title="中国化工网" target="_blank"> <img
						alt="中国化工网" src="static/image/footer5.png" /></a> <a
						href="http://www.ceceem.org/" title="中国能源研究会节能与企业能源管理专业委员会"
						target="_blank"> <img alt="中国能源研究会节能与企业能源管理专业委员会"
						src="static/image/footer6.png" /></a>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
<script>
var yamashu;
var nub = $("#yeshu").val();
window.onload = function() {
	getproducts();
}

function getproducts() {	
	var body1 = "";
	var body2 = "";
	$.ajax({
		url : "industryNews",//请求地址，其实就是我们servlet的映射名
		data : {"Newspage":nub},//限定返回（response）的参数类型,当你死都收不到返回值得时候，请把dataType属性改成text,打印一下看看是啥子
		dataType : "json",//限定返回（response）的参数类型
		type : "post",//提交方式
		async : false,//是否同步，如果为FALSE则可以将返回的值return出来，反之则不得行
		success : function(result, status) {
			yamashu = result.countall;
			console.log(yamashu);
			if (yamashu == nub) {
				$("#last").attr("disabled", true);
			}
			$.each(result.list, function(i, entity) {
				body1 += "<div class='news_artical_inner'><div class='news_date'>"
						+"<div>"+entity.dynamic_date
						+"</div></div><div class='news_title'>"
						+"<a href='#'>"+entity.dynamic_title+"</a></div>"
						+"<div class='news_info'>"
						+"<p>"+entity.dynamic_content+"</p></div></div>"
				if (i < 5) {
					body2 += "<li><a href='#'>"+entity.dynamic_title
							+ "</a></li>";
				}
			});
			$(".news_artical_out").html("");
			$(".productss").html("");
			$(".news_artical_out").append(body1);
			$(".productss").append(body2);
		}
	});
}
function fenye() {
	/*获取test框中的页码  */
	if (yamashu > nub) {
		nub++;
		$("#yeshu").val(nub);
		$("#first").attr("disabled", false);
		$(".formMiddlecenter").html("");
		getproducts();
	}
}
function fenyeq() {
	nub--;
	$("#yeshu").val(nub);
	getproducts();
	if (nub == 1) {
		$("#first").attr("disabled", true);
		$("#last").attr("disabled", false);
	} else {
		$("#last").attr("disabled", false);
	}
}
</script>